package learn_concurrent._4;

import org.openjdk.jol.info.ClassLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class T1 {
	static final Logger logger = LoggerFactory.getLogger(T1.class);

	public static void main(String[] args) throws InterruptedException {

//		System.out.println(ClassLayout.parseClass(Dog.class, new RawLayouter(new CurrentDataModel())).toPrintable());
//		System.out.println("-------------------");
//		System.out.println(ClassLayout.parseClass(Dog.class, new HotSpotLayouter(new CurrentDataModel())).toPrintable());
//		System.out.println("-------------------");
//		System.out.println(ClassLayout.parseClass(Dog.class).toPrintable());

		Dog d = new Dog();
		System.out.println(ClassLayout.parseInstance(d).toPrintable());

//		Thread.sleep(4000);
//		System.out.println(ClassLayout.parseInstance(new Dog()).toPrintable());
		synchronized (d) {
			System.out.println(ClassLayout.parseInstance(d).toPrintable());
		}

		System.out.println(ClassLayout.parseInstance(d).toPrintable());
	}

}

class Dog {
	int i = 10;
	int j = 20;
	
	long l = 20000L;

	String[] strs = { "1", "2" };

	void foo() {
		System.out.println("aaa");
	}

	void boo() {

	}
}